﻿using System.Dynamic;

namespace Jim.OA;

/// <summary>
/// 转发、意见征询、转办
/// </summary>
[Sdk("/api/workflow/paService/rejectRequest",description: "转发、意见征询、转办")]
public class OAForwardRequestInput : OAUserRequest<SdkResponse>, ISdkCustomDic
{
    [Required(ErrorMessage = "流程ID不能为空")]
    public string RequestId { get; set; }
    /// <summary>
    /// 标识1 : 转发 2：意见征询 3：转办
    /// </summary>
    [Required(ErrorMessage ="标识不能为空")]
    public int forwardFlag { get; set; }
    /// <summary>
    /// 接收人ID串，注意如果是转办 接收人只能是一个人
    /// </summary>
    [Required(ErrorMessage = "接收人不能为空")]
    public string ForwardResourceIds { get; set; }
    public string SignDocIds { get; set; }
    public string SignWorkflowIds { get; set; }
    public string AnnexDocIds { get; set; }
    /// <summary>
    /// 意见内容
    /// </summary>
    public string Remark { get; set; }

    public SdkDictionary Dic()
    {
        SdkDictionary dic = new SdkDictionary();
        dic.Add("requestId", RequestId);
        dic.Add("forwardFlag", forwardFlag);
        dic.Add("forwardResourceIds", ForwardResourceIds);
        dynamic otherParams = new ExpandoObject();
        if (!string.IsNullOrEmpty(AnnexDocIds)) otherParams.annexdocids = AnnexDocIds;
        if (!string.IsNullOrEmpty(SignWorkflowIds)) otherParams.signworkflowids = SignWorkflowIds;
        if (!string.IsNullOrEmpty(SignDocIds)) otherParams.signdocids = SignDocIds;
        dic.Add("otherParams", otherParams);
        dic.Add("remark", Remark);
        return dic;
    }
}